import Vue from 'vue'
import App from './App.vue'
import router from './routers/router'
import store from './stores/store'

// 引入axios
import axios from "axios"
Vue.prototype.axios = axios;

// 引入外部的css和js
import "@/assets/css/base.css"
import "@/assets/js/rem.js"

// 引入elementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

// 页面跳转回到顶部
router.afterEach((to,from,next)=>{
  window.scrollTo(0,0)
});


// router.beforeEach((to, from, next) => {
//   // chrome
//   document.body.scrollTop = 0
//   // firefox
//   document.documentElement.scrollTop = 0
//   // safari
//   window.pageYOffset = 0
//   next()
//
// })

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app');
